import java.io.File;
import java.util.Scanner;

public class Test {
    public static int fib(int n){
        int x = 1;
        int y = 1;
        int tmp = x + y;
        while (n >= 3){
            x = x + tmp;
            y = x + tmp;
            tmp = x + y;
            n--;
        }
        return tmp;
    }

    public static int Fib(int n){
        if (n == 1 || n == 2){
            return 1;
        }
        return  Fib(n-2) + Fib(n-1);
    }

    public static int sum(int n){
        if (n == 1){
            return 1;
        }
        return n + sum(n-1);
    }

    public static void main(String[] args) {
        int sum = sum(10);
        System.out.println(sum);
        //System.out.println(Fib(3000));
        System.out.println(fib(7));
    }
    public static int add(int x,int y){
        return x  + y;
    }
    public static double add(double x,double y){
        return x + y;
    }
    public static int add(int x, int y,int z){
        return x + y + z;
    }
    public static void main6(String[] args) {
        int add = add(10, 20);
        System.out.println(add);
    }
    public static int Add(int x,int y){
        return x + y;
    }
    public static double AddDouble(double x, double y){
        return x + y;
    }
    public static int AddTri(int x,int y,int z){
        return x + y + z;
    }

    public static void main5(String[] args) {
        int add = Add(10, 20);
        double v = AddDouble(10.2, 11.5);
        int i = AddTri(10, 20, 30);
        System.out.println(add);
        System.out.println(v);
        System.out.println(i);
    }
    public static void Swap(int x,int y){
        int tmp = x;
        x = y;
        y = tmp;
    }

    public static void main4(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println(a);
        System.out.println(b);
        System.out.println("==========");
        Swap(a,b);
        System.out.println(a);
        System.out.println(b);
    }
    public static void main3(String[] args) {
        int x = 10;
        int y = 20;
        System.out.println(x);
        System.out.println(y);
        System.out.println("==========");
        int tmp = x;
        x = y;
        y = tmp;
        System.out.println(x);
        System.out.println(y);
    }
//    public static int add(int x,int y){
//        return x + y;
//    }

    public static void isPrime(int n) {
        // 判断一个数是否是素数
        int i = 2;
        for (;i < n;i++){
            if (n % i == 0){
                break;
            }
        }
        if (n == i){
            System.out.println(n + "是个质数");
        }else {
            System.out.println(n + "不是个质数 ");
        }
    }

    public static void main2(String[] args) {
        isPrime(5);
        isPrime(6);
        System.out.println(add(2, 5));
        int add = add(2, 4);
    }
    public static boolean isLearYear(int year){
        if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)  ){
            return true;
        }else {
            return false;
        }
    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int year = scanner.nextInt();
        boolean ret = isLearYear(year);
        if (ret){
            System.out.println(year + "是个闰年");
        }else {
            System.out.println(year + "不是个闰年");
        }
    }
}